package com.shunwang.caipiao.data.bo.impl;

import java.util.List;

import com.shunwang.caipiao.data.bo.CaiPiaoBo;
import com.shunwang.caipiao.data.dao.CaiPiaoDao;
import com.shunwang.caipiao.data.pojo.DoubleColor;

public class CaiPiaoBoImpl implements CaiPiaoBo {

	private CaiPiaoDao dao;
	@Override
	public List<DoubleColor> getDoubleColorAll() {
		return dao.getDoubleColorAll();
	}

	@Override
	public void saveDoubleColor(DoubleColor doubleColor) {
		if(doubleColor == null || doubleColor.getSno() == null){
			throw new IllegalArgumentException("保存失败,没有想过的doubleColor信息");
		}
		dao.saveDoubleColor(doubleColor);
	}

	@Override
	public void deleteDoubleColor(Integer sno) {
		if(sno == null){
			throw new IllegalArgumentException("删除失败,必须指定sno信息");
		}
		dao.deleteDoubleColor(sno);
	}

	@Override
	public void clearDoubleColor() {
		dao.clearDoubleColor();
	}

	@Override
	public boolean checkSnoExists(Integer sno) {
		if(sno == null){
			throw new IllegalArgumentException("删除失败,必须指定sno信息");
		}
		return dao.checkSnoExists(sno);
	}

	@Override
	public DoubleColor getDoubleColor(Integer sno) {
		if(sno == null){
			throw new IllegalArgumentException("删除失败,必须指定sno信息");
		}
		return dao.getDoubleColor(sno);
	}

	public CaiPiaoDao getDao() {
		return dao;
	}

	public void setDao(CaiPiaoDao dao) {
		this.dao = dao;
	}

}
